<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Coverage Report</title>
<link title="Style" type="text/css" rel="stylesheet" href="css/main.css"/>
<script type="text/javascript" src="js/popup.js"></script>
</head>
<body>
<h5>Coverage Report - org.sakaiproject.genericdao.springjdbc.translators.MSSQLTranslator</h5>
<div class="separator">&nbsp;</div>
<table class="report">
<thead><tr>  <td class="heading">Classes in this File</td>  <td class="heading" width="20%"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Line Coverage</a></td>  <td class="heading" width="20%"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Branch Coverage</a></td>  <td class="heading" width="10%"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Complexity</a></td></tr></thead>
  <tr><td class="text"><a href="org.sakaiproject.genericdao.springjdbc.translators.MSSQLTranslator.html">MSSQLTranslator</a></td><td class="value"><table cellpadding="0" cellspacing="0" align="right"><tr><td>0%&nbsp;</td><td><table class="percentGraph" cellpadding="0" cellspacing="0" width="100"><tr><td class="covered" width="0"></td><td class="uncovered" width="100"></td></tr></table></td></tr></table></td><td class="value"><table cellpadding="0" cellspacing="0" align="right"><tr><td>0%&nbsp;</td><td><table class="percentGraph" cellpadding="0" cellspacing="0" width="100"><tr><td class="covered" width="0"></td><td class="uncovered" width="100"></td></tr></table></td></tr></table></td><td class="value"><span class="hidden">1.0;</span>1</td></tr>
</table>
<div class="separator">&nbsp;</div>
<table cellspacing="0" cellpadding="0" class="src">
<tr>
  <td class="numLine">&nbsp;1</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;2</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * $Id: org.sakaiproject.genericdao.springjdbc.translators.MSSQLTranslator.html 11 2009-01-29 14:58:33Z azeckoski $</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;3</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * $URL: http://genericdao.googlecode.com/svn/maven/site/cobertura/org.sakaiproject.genericdao.springjdbc.translators.MSSQLTranslator.html $</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;4</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * MSSQLTranslator.java - genericdao - Apr 26, 2008 3:17:46 PM - azeckoski</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;5</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> **************************************************************************</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;6</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * Copyright (c) 2008 Aaron Zeckoski</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;7</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * Licensed under the Apache License, Version 2</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;8</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;9</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * A copy of the Apache License, Version 2 has been included in this </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;10</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * distribution and is available at: http://www.apache.org/licenses/LICENSE-2.0.txt</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;11</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;12</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * Aaron Zeckoski (azeckoski@gmail.com) (aaronz@vt.edu) (aaron@caret.cam.ac.uk)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;13</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;14</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;15</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">package</span> org.sakaiproject.genericdao.springjdbc.translators;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;16</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;17</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;18</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * Microsoft SQL Server (MSSQL) translator</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;19</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;20</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * @author Aaron Zeckoski (azeckoski@gmail.com)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;21</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;22</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<span class="keyword">public</span> <span class="keyword">class</span> MSSQLTranslator <span class="keyword">extends</span> BasicTranslator {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;23</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;24</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;   <span class="keyword">public</span> String handlesDB() {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;25</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;      <span class="keyword">return</span> DBTYPE_MSSQL;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;26</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;   }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;27</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;28</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;   <span class="keyword">public</span> String makeAutoIdQuery(String tableName, String idColumnName) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;29</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;      <span class="keyword">return</span> <span class="string">"SELECT SCOPE_IDENTITY()"</span>;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;30</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;   }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;31</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;32</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;   <span class="keyword">public</span> String makeLimitQuery(String sql, <span class="keyword">long</span> start, <span class="keyword">long</span> limit, String tableName) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;33</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      <span class="comment">// NOTE: no support for start/offset</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;34</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;      <span class="keyword">return</span> <span class="keyword">new</span> StringBuilder( sql.length()+8 )</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;35</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;         .append(sql)</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;36</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;         .insert( getAfterSelectInsertPoint(sql), <span class="string">" top "</span> + limit )</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;37</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;         .toString();</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;38</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;   }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;39</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;40</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;   <span class="keyword">private</span> <span class="keyword">int</span> getAfterSelectInsertPoint(String sql) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;41</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;      <span class="keyword">int</span> selectIndex = sql.toLowerCase().indexOf( <span class="string">"select"</span> );</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;42</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;      <span class="keyword">final</span> <span class="keyword">int</span> selectDistinctIndex = sql.toLowerCase().indexOf( <span class="string">"select distinct"</span> );</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;43</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;      <span class="keyword">return</span> selectIndex + ( selectDistinctIndex == selectIndex ? 15 : 6 );</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;44</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;   }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;45</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;46</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;}</pre></td>
</tr>
</table>
<div class="footer">
Reports generated by <a href="http://cobertura.sourceforge.net/" target="_top">Cobertura</a>.
</div>
</body>
</html>
